'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    try {
      await queryInterface.bulkInsert('Memberships', [
        {
          name: '月付',
          durationMonths: 1,
          price: 10,
          rank: 1,
          description: '超值之选',
          createdAt: new Date(),
          updatedAt: new Date(),
        },
        {
          name: '年付',
          durationMonths: 2,
          price: 100,
          rank: 1,
          description: '已经优惠 <san><strong>20元</strong></span>',
          createdAt: new Date(),
          updatedAt: new Date(),
        },
      ]);
    } catch (error) {
      console.log(error);
    }
  },

  async down(queryInterface, Sequelize) {
    /**
     * Add commands to revert seed here.
     *
     * Example:
     * await queryInterface.bulkDelete('People', null, {});
     */
    await queryInterface.bulkDelete('Memberships', null, {});
  },
};
